Skip to content

fix(serializer): fix union types denormalization fallback after security mismatch#8333

Merged
soyuka merged 2 commits into
api-platform:4.3from
jonnyeom:fix/regression-8329-fix-multiple-type-check
Jun 19, 2026
Merged

fix(serializer): fix union types denormalization fallback after security mismatch#8333
soyuka merged 2 commits into
api-platform:4.3from
jonnyeom:fix/regression-8329-fix-multiple-type-check

Conversation

@jonnyeom

Copy link
Copy Markdown
Contributor

Closes #8329

This PR

  • Adds Test to prove broken functionality / regression
  • Updates to fix regression

Original Issue

  • Regression found where Union type properties were not denormalizing when the first type does not match.
  • This was caused by a new Exception being thrown with a Type Guard.

Solution

  • Update the Exception type to be one that is caught by the union type handler.

Considerations

  • NotNormalizableValueException being thrown after a security check doesnt make the biggest sense to me. However, InvalidArgumentException also does not make 100 percent sense either so I think it is okay. Other wise, we would have to create a new Exception and catch it, similar to NotNormalizableValueException.

@jonnyeom jonnyeom changed the title Add test to break UnionType denormalization after type confusion guard fix(serializer): fix union types denormalization fallback after security mismatch Jun 18, 2026
@soyuka soyuka merged commit 2abda53 into api-platform:4.3 Jun 19, 2026
108 of 112 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants